package ar.edu.itba.pod.legajo46470.balance;

import ar.edu.itba.node.NodeInformation;

public class AgentBalanceInfo implements Comparable<AgentBalanceInfo>{
	private NodeInformation node;
	private int agentsQty;
	
	public AgentBalanceInfo(NodeInformation node, int agentsQty) {
		this.node = node;
		this.agentsQty = agentsQty;
	}
	
	public int getAgentsQty() {
		return agentsQty;
	}
	
	public NodeInformation getNode() {
		return node;
	}
	
	public void setAgentsQty(int agentsQty) {
		this.agentsQty = agentsQty;
	}

	@Override
	public int compareTo(AgentBalanceInfo o) {
		return agentsQty - o.getAgentsQty();
	}

	

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((node == null) ? 0 : node.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AgentBalanceInfo other = (AgentBalanceInfo) obj;
		if (node == null) {
			if (other.node != null)
				return false;
		} else if (!node.equals(other.node))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "AgentBalanceInfo [node=" + node + ", agentsQty=" + agentsQty
				+ "]";
	}
	
	
	
	
}
